import { Application } from 'egg';

export default (app: Application) => {
    const { controller, router } = app;

    /**
     * @api {post} /api/admin/login 后台登录
     * @apiName login
     * @apiGroup admin
     *
     * @apiParam {String} admin_username 账号.
     * @apiParam {String} admin_password 密码.
     *
     * @apiSuccess {int} code 返回状态码（1：登录成功，2：登录失败，3：服务器出错，4：参数不全）
     * @apiSuccess {String} msg 返回状态码对应的信息
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.token 登录成功后返回的token
     * @apiSuccess {String} data.admin_username 管理员账号
     *
     */
    router.post('/api/admin/login', controller.admin.login);

    /**
     * @api {post} /api/admin/createAdmin 新增管理员
     * @apiName createAdmin
     * @apiGroup admin
     *
     * @apiParam {String} admin_username 用户名.
     * @apiParam {String} admin_password 密码.
     * @apiParam {String} admin_remark 备注.
     *
     */
    router.post('/api/admin/createAdmin', controller.admin.createAdmin);

    /**
     * @api {post} /api/admin/searchAdmin 查找管理员
     * @apiName searchAdmin
     * @apiGroup admin
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.admin_id 管理员id
     * @apiSuccess {String} data.admin_username 用户名
     * @apiSuccess {String} data.admin_remark 备注
     * @apiSuccess {String} data.admin_status 状态（1：启用，2：停用）
     *
     */
    router.post('/api/admin/searchAdmin', controller.admin.searchAdmin);

    /**
     * @api {post} /api/admin/updateAdmin 修改管理员
     * @apiName updateAdmin
     * @apiGroup admin
     *
     * @apiParam {String} target_admin_id 用户id.
     * @apiParam {String} target_admin_password 用户密码.
     *
     */
    router.post('/api/admin/updateAdmin', controller.admin.updateAdmin);

    /**
     * @api {post} /api/admin/updateAdminPhone 重绑手机号
     * @apiName updateAdminPhone
     * @apiGroup admin
     *
     * @apiParam {String} target_admin_id 用户id.
     * @apiParam {String} admin_phone 手机号.
     *
     */
    router.post('/api/admin/updateAdminPhone', controller.admin.udpateAdminPhone);

    /**
     * @api {post} /api/admin/startAndStopAdmin 启用、停用管理员
     * @apiName startAndStopAdmin
     * @apiGroup admin
     *
     * @apiParam {String} target_admin_id 用户id.
     * @apiParam {String} type 操作类型（1：启用，2：停用）.
     *
     */
    router.post('/api/admin/startAndStopAdmin', controller.admin.startAndStopAdmin);

    /**
     * @api {post} /api/admin/sendSMS 发送验证码
     * @apiName sendSMS
     * @apiGroup admin
     *
     * @apiParam {String} admin_username 账号.
     *
     */
    router.post('/api/admin/sendSMS', controller.admin.sendSMS);

    /**
     * @api {post} /api/admin/forgetPassword 找回密码
     * @apiName forgetPassword
     * @apiGroup admin
     *
     * @apiParam {String} admin_username 账号.
     * @apiParam {String} admin_password 密码.
     * @apiParam {String} code 验证码.
     *
     */
    router.post('/api/admin/forgetPassword', controller.admin.forgetPassword);

    /**
     * @api {post} /api/workUnit/createWorkUnit 创建单位
     * @apiName createWorkUnit
     * @apiGroup workUnit
     *
     * @apiParam {String} admin_id 管理员id.
     * @apiParam {String} work_unit_name 单位名.
     * @apiParam {String} [department_id] 部门id（多个id用逗号隔开）.
     *
     */
    router.post('/api/workUnit/createWorkUnit', controller.workUnit.createWorkUnit);

    /**
     * @api {post} /api/workUnit/deleteWorkUnit 删除单位
     * @apiName deleteWorkUnit
     * @apiGroup workUnit
     *
     * @apiParam {String} admin_id 管理员id.
     * @apiParam {String} work_unit_id 单位id.
     *
     */
    router.post('/api/workUnit/deleteWorkUnit', controller.workUnit.deleteWorkUnit);

    /**
     * @api {post} /api/workUnit/searchWorkUnit 查找单位
     * @apiName searchWorkUnit
     * @apiGroup workUnit
     *
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.work_unit_id 单位id
     * @apiSuccess {String} data.work_unit_name 单位名
     * @apiSuccess {int} data.employee_num 员工数
     *
     */
    router.post('/api/workUnit/searchWorkUnit', controller.workUnit.searchWorkUnit);

    /**
     * @api {post} /api/workUnit/searchWorkUnitById 根据单位id查找单位信息
     * @apiName searchWorkUnitById
     * @apiGroup workUnit
     *
     * @apiParam {String} work_unit_id 单位id.
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.work_unit_id 单位id
     * @apiSuccess {String} data.work_unit_name 单位名
     * @apiSuccess {Object[]} data.departmentList 部门列表
     * @apiSuccess {String} data.departmentList.department_id 部门id
     * @apiSuccess {String} data.departmentList.department_name 部门名称
     *
     */
    router.post('/api/workUnit/searchWorkUnitById', controller.workUnit.searchWorkUnitById);

    /**
     * @api {post} /api/workUnit/updateWorkUnit 修改单位
     * @apiName updateWorkUnit
     * @apiGroup workUnit
     *
     * @apiParam {String} admin_id 管理员id.
     * @apiParam {String} work_unit_id 单位id.
     * @apiParam {String} work_unit_name 单位名.
     * @apiParam {String} [department_id] 部门id（多个id用逗号隔开）.
     *
     */
    router.post('/api/workUnit/updateWorkUnit', controller.workUnit.updateWorkUnit);

    /**
     * @api {post} /api/department/createDepartment 创建部门
     * @apiName createDepartment
     * @apiGroup department
     *
     * @apiParam {String} admin_id 管理员id.
     * @apiParam {String} department_name 部门名.
     * @apiParam {String} [position_id] 职位id（多个id用逗号隔开）.
     *
     */
    router.post('/api/department/createDepartment', controller.department.createDepartment);

    /**
     * @api {post} /api/department/deleteDepartment 删除部门
     * @apiName deleteDepartment
     * @apiGroup department
     *
     * @apiParam {String} admin_id 管理员id.
     * @apiParam {String} department_id 部门id.
     *
     */
    router.post('/api/department/deleteDepartment', controller.department.deleteDepartment);

    /**
     * @api {post} /api/department/searchDepartment 查找部门
     * @apiName searchDepartment
     * @apiGroup department
     *
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.department_id 部门id
     * @apiSuccess {String} data.department_name 部门名
     * @apiSuccess {int} data.position_num 职位数
     * @apiSuccess {int} data.employee_num 员工数
     *
     */
    router.post('/api/department/searchDepartment', controller.department.searchDepartment);

    /**
     * @api {post} /api/department/searchDepartmentById 根据部门id查找部门信息
     * @apiName searchDepartmentById
     * @apiGroup department
     *
     * @apiParam {String} department_id 部门id.
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.department_id 部门id
     * @apiSuccess {String} data.department_id_name 部门名
     * @apiSuccess {Object[]} data.positionList 职位列表
     * @apiSuccess {String} data.positionList.position_id 职位id
     * @apiSuccess {String} data.positionList.position_name 职位名称
     *
     */
    router.post('/api/department/searchDepartmentById', controller.department.searchDepartmentById);

    /**
     * @api {post} /api/department/updateDepartment 修改部门
     * @apiName updateDepartment
     * @apiGroup department
     *
     * @apiParam {String} admin_id 管理员id.
     * @apiParam {String} department_id 部门id.
     * @apiParam {String} department_name 部门名.
     * @apiParam {String} [position_id] 职位id（多个id用逗号隔开）.
     *
     */
    router.post('/api/department/updateDepartment', controller.department.updateDepartment);

    /**
     * @api {post} /api/position/createPosition 创建职位
     * @apiName createPosition
     * @apiGroup position
     *
     * @apiParam {String} admin_id 管理员id.
     * @apiParam {String} position_name 职位名.
     * @apiParam {String} position_is_evaluate 是否可评价（0：否，1：是）.
     * @apiParam {String} position_remark 备注.
     *
     */
    router.post('/api/position/createPosition', controller.position.createPosition);

    /**
     * @api {post} /api/position/deletePosition 删除职位
     * @apiName deletePosition
     * @apiGroup position
     *
     * @apiParam {String} admin_id 管理员id.
     * @apiParam {String} position_id 职位id.
     *
     */
    router.post('/api/position/deletePosition', controller.position.deletePosition);

    /**
     * @api {post} /api/position/searchPosition 查找职位
     * @apiName searchPosition
     * @apiGroup position
     *
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.position_id 职位id
     * @apiSuccess {String} data.position_name 职位名
     * @apiSuccess {String} data.position_is_evaluate 是否可评价（0：否，1：是）
     * @apiSuccess {String} data.position_remark 备注
     *
     */
    router.post('/api/position/searchPosition', controller.position.searchPosition);

    /**
     * @api {post} /api/position/searchPositionById 根据职位id查找职位信息
     * @apiName searchPositionById
     * @apiGroup position
     *
     * @apiParam {String} position_id 职位id.
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.position_id 职位id
     * @apiSuccess {String} data.position_name 职位名
     * @apiSuccess {String} data.position_is_evaluate 是否可评价（0：否，1：是）
     * @apiSuccess {String} data.position_remark 备注
     *
     */
    router.post('/api/position/searchPositionById', controller.position.searchPositionById);

    /**
     * @api {post} /api/position/updatePosition 修改职位
     * @apiName updatePosition
     * @apiGroup position
     *
     * @apiParam {String} admin_id 管理员id.
     * @apiParam {String} position_id 职位id.
     * @apiParam {String} position_name 职位名.
     * @apiParam {String} position_is_evaluate 是否可评价（0：否，1：是）.
     * @apiParam {String} position_remark 备注.
     *
     */
    router.post('/api/position/updatePosition', controller.position.updatePosition);

    /**
     * @api {post} /api/employee/createEmployee 新增职员
     * @apiName createEmployee
     * @apiGroup employee
     *
     * @apiParam {String} admin_id 管理员id.
     * @apiParam {String} employee_name 职员姓名.
     * @apiParam {String} employee_account 账号.
     * @apiParam {String} employee_password 密码.
     * @apiParam {String} work_unit_id 单位id.
     * @apiParam {String} department_id 部门id.
     * @apiParam {String} position_id 职位id.
     *
     */
    router.post('/api/employee/createEmployee', controller.employee.createEmployee);

    /**
     * @api {post} /api/employee/deleteEmployee 删除职员
     * @apiName deleteEmployee
     * @apiGroup employee
     *
     * @apiParam {String} admin_id 管理员id.
     * @apiParam {String} employee_id 职员id.
     *
     */
    router.post('/api/employee/deleteEmployee', controller.employee.deleteEmployee);

    /**
     * @api {post} /api/employee/searchEmployee 查找职员
     * @apiName searchEmployee
     * @apiGroup employee
     *
     * @apiParam {String} page 页码.
     * @apiParam {String} size 一页显示数.
     * @apiParam {String} [work_unit_id] 单位id.
     * @apiParam {String} [department_id] 部门id.
     * @apiParam {String} [position_id] 职位id.
     * @apiParam {String} [register_start_time] 注册开始时间.
     * @apiParam {String} [register_end_time] 注册结束时间.
     * @apiParam {String} [employee_status] 职员状态（1：待审核，2：已通过，3：不通过，4：已停用）.
     * @apiParam {String} [employee_name] 职员名/账号.
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {int} data.count 数据总数
     * @apiSuccess {Object[]} data.employee_list 职员列表
     * @apiSuccess {String} data.employee_list.employee_id 职员id
     * @apiSuccess {String} data.employee_list.employee_name 职员名
     * @apiSuccess {String} data.employee_list.employee_account 职员账号
     * @apiSuccess {String} data.employee_list.work_unit_name 单位名
     * @apiSuccess {String} data.employee_list.department_name 部门名
     * @apiSuccess {String} data.employee_list.position_name 职位名
     * @apiSuccess {String} data.employee_list.created_at 注册时间
     * @apiSuccess {String} data.employee_list.employee_status 职员状态（1：待审核，2：已通过，3：已禁止，4：已停用）
     *
     */
    router.post('/api/employee/searchEmployee', controller.employee.searchEmployee);

    /**
     * @api {post} /api/employee/searchAllEmployee 查找全部职员
     * @apiName searchAllEmployee
     * @apiGroup employee
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.employee_id 职员id
     * @apiSuccess {String} data.employee_name 职员名
     * @apiSuccess {String} data.employee_account 职员账号
     * @apiSuccess {String} data.work_unit_name 单位名
     * @apiSuccess {String} data.department_name 部门名
     * @apiSuccess {String} data.position_name 职位名
     * @apiSuccess {String} data.created_at 注册时间
     * @apiSuccess {String} data.employee_status 职员状态（1：待审核，2：已通过，3：已禁止，4：已停用）
     *
     */
    router.post('/api/employee/searchAllEmployee', controller.employee.searchAllEmployee);

    /**
     * @api {post} /api/employee/searchEmployeeById 根据职员id查找职员信息
     * @apiName searchEmployeeById
     * @apiGroup employee
     *
     * @apiParam {String} employee_id 职员id.
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.employee_id 职员id
     * @apiSuccess {String} data.employee_name 职员名
     * @apiSuccess {String} data.employee_account 账号
     * @apiSuccess {String} data.employee_password 密码
     * @apiSuccess {String} data.work_unit_id 单位id
     * @apiSuccess {String} data.department_id 部门id
     * @apiSuccess {String} data.position_id 职位id
     *
     */
    router.post('/api/employee/searchEmployeeById', controller.employee.searchEmployeeById);

    /**
     * @api {post} /api/employee/updateEmployee 修改职员
     * @apiName updateEmployee
     * @apiGroup employee
     *
     * @apiParam {String} admin_id 管理员id.
     * @apiParam {String} employee_id 职员id.
     * @apiParam {String} employee_name 职员姓名.
     * @apiParam {String} employee_password 密码.
     * @apiParam {String} work_unit_id 单位id.
     * @apiParam {String} department_id 部门id.
     * @apiParam {String} position_id 职位id.
     *
     */
    router.post('/api/employee/updateEmployee', controller.employee.updateEmployee);

    /**
     * @api {post} /api/employee/updateEmployeeStatus 更新职员状态
     * @apiName updateEmployeeStatus
     * @apiGroup employee
     *
     * @apiParam {String} admin_id 管理员id.
     * @apiParam {String} employee_id 职员id.
     * @apiParam {String} type 操作类型（1：通过，2：禁止，3：停用，4：启用）.
     *
     */
    router.post('/api/employee/updateEmployeeStatus', controller.employee.updateEmployeeStatus);

    /**
     * @api {post} /api/project/createProject 创建考核项目
     * @apiName createProject
     * @apiGroup project
     *
     * @apiParam {String} admin_id 管理员id.
     * @apiParam {String} project_name 项目考核名.
     * @apiParam {String} project_rule 考核规则.
     * @apiParam {String} project_min 打分最小单位.
     * @apiParam {String} project_max 给同一个人最多可以打多少分.
     * @apiParam {String} project_is_self 是否可以给自己打分（1：是，2：否）.
     * @apiParam {String} project_start_time 开始时间.
     * @apiParam {String} project_end_time 结束时间.
     * @apiParam {String} employee_id 加分对象id（多个id用逗号隔开）.
     * @apiParam {String} target_employee_id 被加分对象id（多个id用逗号隔开）.
     * @apiParam {Object} position_list 职位加分规则对象字符串.
     * @apiParam {String} position_list.position_id 职位id.
     * @apiParam {String} position_list.project_score 可加多少分.
     *
     */
    router.post('/api/project/createProject', controller.project.createProject);

    /**
     * @api {post} /api/project/searchProject 查找考核项目
     * @apiName searchProject
     * @apiGroup project
     *
     * @apiParam {String} page 页码.
     * @apiParam {String} size 一页显示数.
     * @apiParam {String} [status] 状态（1：未开始，2：进行中，3：暂停，4：已结束）.
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {int} data.count 数据总数
     * @apiSuccess {Object[]} data.project_list 项目列表
     * @apiSuccess {String} data.project_list.project_id 项目id
     * @apiSuccess {String} data.project_list.project_name 项目名
     * @apiSuccess {String} data.project_list.project_start_time 开始时间
     * @apiSuccess {String} data.project_list.project_end_time 结束时间
     * @apiSuccess {String} data.project_list.project_status 状态（1：未开始，2：进行中，3：暂停，4：已结束）
     * @apiSuccess {String} data.project_list.schedule 进度
     * @apiSuccess {String} data.project_list.surplus 剩余考核人
     *
     */
    router.post('/api/project/searchProject', controller.project.searchProject);

    /**
     * @api {post} /api/project/searchProjectById 根据项目id查找项目信息
     * @apiName searchProjectById
     * @apiGroup project
     *
     * @apiParam {String} project_id 项目id.
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.project_id 项目id
     * @apiSuccess {String} data.project_name 项目名
     * @apiSuccess {String} data.project_rule 考核规则说明
     * @apiSuccess {int} data.project_min 打分最小单位
     * @apiSuccess {int} data.project_max 给同一个人最多可以打多少分
     * @apiSuccess {String} data.project_is_self 是否可以给自己打分（1：是，2：否）
     * @apiSuccess {String} data.project_start_time 开始时间
     * @apiSuccess {String} data.project_end_time 结束时间
     * @apiSuccess {String} data.project_status 状态
     * @apiSuccess {Object} data.employee 加分对象
     * @apiSuccess {String} data.employee.employee_id 加分对象id
     * @apiSuccess {Object} data.target_employee 被加分对象
     * @apiSuccess {String} data.target_employee.employee_id 被加分对象id
     * @apiSuccess {Object} data.position_list 职位加分规则
     * @apiSuccess {String} data.position_list.position_id 职位id
     * @apiSuccess {int} data.position_list.project_score 可加分数
     *
     */
    router.post('/api/project/searchProjectById', controller.project.searchProjectById);

    /**
     * @api {post} /api/project/updateProject 修改项目
     * @apiName updateProject
     * @apiGroup project
     *
     * @apiParam {String} admin_id 管理员id.
     * @apiParam {String} project_id 项目id.
     * @apiParam {String} project_name 项目考核名.
     * @apiParam {String} project_rule 考核规则.
     * @apiParam {String} project_min 打分最小单位.
     * @apiParam {String} project_max 给同一个人最多可以打多少分.
     * @apiParam {String} project_is_self 是否可以给自己打分（1：是，2：否）.
     * @apiParam {String} project_start_time 开始时间.
     * @apiParam {String} project_end_time 结束时间.
     * @apiParam {String} employee_id 加分对象id（多个id用逗号隔开）.
     * @apiParam {String} target_employee_id 被加分对象id（多个id用逗号隔开）.
     * @apiParam {Object} position_list 职位加分规则对象字符串.
     * @apiParam {String} position_list.position_id 职位id.
     * @apiParam {String} position_list.project_score 可加多少分.
     *
     */
    router.post('/api/project/updateProject', controller.project.updateProject);

    /**
     * @api {post} /api/project/startAndStopProject 启动和暂停项目
     * @apiName startAndStopProject
     * @apiGroup project
     *
     * @apiParam {String} admin_id 管理员id.
     * @apiParam {String} project_id 项目id.
     * @apiParam {String} type 操作类型（1：启动，2：暂停）.
     *
     */
    router.post('/api/project/startAndStopProject', controller.project.startAndStopProject);

    /**
     * @api {post} /api/project/searchTopTenAndAvg 查找前十名以及最高分，最低分，平均分
     * @apiName searchTopTenAndAvg
     * @apiGroup project
     *
     * @apiParam {String} project_id 项目id.
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {Object[]} data.topTenList 前十名列表
     * @apiSuccess {String} data.topTenList.employee_id 职员id
     * @apiSuccess {String} data.topTenList.employee_name 职员名
     * @apiSuccess {int} data.topTenList.work_unit_name 单位名
     * @apiSuccess {int} data.topTenList.score 分数
     * @apiSuccess {int} data.max 最高分
     * @apiSuccess {int} data.min 最低分
     * @apiSuccess {int} data.avg 平均分
     *
     */
    router.post('/api/project/searchTopTenAndAvg', controller.project.searchTopTenAndAvg);

    /**
     * @api {post} /api/project/searchTargetEmployeeList 根据项目id查找项目评分列表
     * @apiName searchTargetEmployeeList
     * @apiGroup project
     *
     * @apiParam {String} page 页码.
     * @apiParam {String} szie 一页显示数.
     * @apiParam {String} project_id 项目id.
     * @apiParam {String} [work_unit_id] 单位id.
     * @apiParam {String} [department_id] 部门id.
     * @apiParam {String} [position_id] 职位id.
     * @apiParam {String} [register_start_time] 开始时间.
     * @apiParam {String} [register_end_time] 结束时间.
     * @apiParam {String} [employee_name] 姓名/账号.
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.employee_id 职员id
     * @apiSuccess {String} data.employee_name 职员名
     * @apiSuccess {int} data.score 总分
     * @apiSuccess {String} data.work_unit_name 单位名
     * @apiSuccess {String} data.department_name 部门名
     * @apiSuccess {String} data.position_name 职位名
     *
     */
    router.post('/api/project/searchTargetEmployeeList', controller.project.searchTargetEmployeeList);

    /**
     * @api {post} /api/project/searchDetailListByEmployee 查找谁评的分详情列表
     * @apiName searchDetailListByEmployee
     * @apiGroup project
     * 
     * @apiParam {String} project_id 项目id.
     * @apiParam {String} employee_id 职员id.
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.employee_id 职员id
     * @apiSuccess {String} data.employee_name 职员名
     * @apiSuccess {String} data.work_unit_name 单位名
     * @apiSuccess {String} data.department_name 部门名
     * @apiSuccess {String} data.position_name 职位名
     * @apiSuccess {String} data.created_at 评论时间
     * @apiSuccess {int} data.score 总分
     *
     */
    router.post('/api/project/searchDetailListByEmployee', controller.project.searchDetailListByEmployee);

    /**
     * @api {post} /api/project/searchDetailListByTargetEmployee 查找他的打分详情列表
     * @apiName searchDetailListByTargetEmployee
     * @apiGroup project
     * 
     * @apiParam {String} project_id 项目id.
     * @apiParam {String} employee_id 职员id.
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.employee_id 职员id
     * @apiSuccess {String} data.employee_name 职员名
     * @apiSuccess {String} data.work_unit_name 单位名
     * @apiSuccess {String} data.department_name 部门名
     * @apiSuccess {String} data.position_name 职位名
     * @apiSuccess {String} data.created_at 评论时间
     * @apiSuccess {int} data.score 总分
     *
     */
    router.post('/api/project/searchDetailListByTargetEmployee', controller.project.searchDetailListByTargetEmployee);

    /**
     * @api {post} /api/project/searchProjectTemplet 随机查找项目模板
     * @apiName searchProjectTemplet
     * @apiGroup project
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.project_name 项目名
     * @apiSuccess {String} data.project_rule 考核规则说明
     * @apiSuccess {int} data.project_min 打分最小单位
     * @apiSuccess {int} data.project_max 给同一个人最多可以打多少分
     * @apiSuccess {String} data.project_is_self 是否可以给自己打分（1：是，2：否）
     * @apiSuccess {Object} data.employee 加分对象
     * @apiSuccess {String} data.employee.employee_id 加分对象id
     * @apiSuccess {Object} data.target_employee 被加分对象
     * @apiSuccess {String} data.target_employee.employee_id 被加分对象id
     * @apiSuccess {Object} data.position_list 职位加分规则
     * @apiSuccess {String} data.position_list.position_id 职位id
     * @apiSuccess {int} data.position_list.project_score 可加分数
     *
     */
    router.post('/api/project/searchProjectTemplet', controller.project.searchProjectTemplet);

    /**
     * @api {post} /api/project/searchSurplus 查找剩余考核人列表
     * @apiName searchSurplus
     * @apiGroup project
     * 
     * @apiParam {String} project_id 项目id.
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.employee_id 职员id
     * @apiSuccess {String} data.employee_name 职员名
     * @apiSuccess {String} data.employee_account 手机号
     * @apiSuccess {String} data.work_unit_name 单位名
     * @apiSuccess {String} data.department_name 部门名
     * @apiSuccess {String} data.position_name 职位名
     *
     */
    router.post('/api/project/searchSurplus', controller.project.searchSurplus);

    /**
     * @api {post} /api/project/searchHasGradedList 查找已经考核人列表
     * @apiName searchHasGradedList
     * @apiGroup project
     * 
     * @apiParam {String} project_id 项目id.
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.employee_id 职员id
     * @apiSuccess {String} data.employee_name 职员名
     * @apiSuccess {String} data.employee_account 手机号
     * @apiSuccess {String} data.work_unit_name 单位名
     * @apiSuccess {String} data.department_name 部门名
     * @apiSuccess {String} data.position_name 职位名
     *
     */
    router.post('/api/project/searchHasGradedList', controller.project.searchHasGradedList);

    /**
     * @api {post} /api/wx/employee/register 注册
     * @apiName register
     * @apiGroup employee-wx
     * 
     * @apiParam {String} employee_phone 手机号（账号）.
     * @apiParam {String} employee_password 密码.
     * @apiParam {String} code 验证码.
     * @apiParam {String} [employee_openId] openid.
     * @apiParam {String} [employee_nickname] 微信昵称.
     * @apiParam {String} [employee_avaTarUrl] 微信头像.
     *
     */
    router.post('/api/wx/employee/register', controller.employee.register);

    /**
     * @api {post} /api/wx/employee/sendSMS 发送短信
     * @apiName sendSMS
     * @apiGroup employee-wx
     * 
     * @apiParam {String} phone 手机号.
     *
     */
    router.post('/api/wx/employee/sendSMS', controller.employee.sendSMS);

    /**
     * @api {post} /api/wx/employee/login 登录
     * @apiName login
     * @apiGroup employee-wx
     * 
     * @apiParam {String} employee_phone 手机号（账号）.
     * @apiParam {String} employee_password 密码.
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.token 用于后期验证登录状态凭证
     *
     */
    router.post('/api/wx/employee/login', controller.employee.login);

    /**
     * @api {post} /api/wx/employee/updatePassword 更新密码
     * @apiName updatePassword
     * @apiGroup employee-wx
     * 
     * @apiParam {String} employee_phone 手机号（账号）.
     * @apiParam {String} employee_password 密码.
     * @apiParam {String} code 验证码.
     *
     */
    router.post('/api/wx/employee/updatePassword', controller.employee.updatePassword);

    /**
     * @api {post} /api/wx/employee/searchEmployeeStatusById 根据职员id获取职员的身份、认证状态
     * @apiName searchEmployeeStatusById
     * @apiGroup employee-wx
     * 
     * @apiParam {String} employee_id 职员id（利用token获取id）
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.employee_name 职员名
     * @apiSuccess {String} data.employee_head_portrait 头像
     * @apiSuccess {String} data.work_unit_id 单位id
     * @apiSuccess {String} data.department_id 部门id
     * @apiSuccess {String} data.position_id 职位id
     * @apiSuccess {String} data.position_is_evaluate 标识是否可评价（0：否，1：是）
     * @apiSuccess {String} data.employee_status 职员状态（1：待审核，2：通过）
     *
     */
    router.post('/api/wx/employee/searchEmployeeStatusById', controller.employee.searchEmployeeStatusById);

    /**
     * @api {post} /api/wx/employee/valiateEmployee 实名认证
     * @apiName valiateEmployee
     * @apiGroup employee-wx
     * 
     * @apiParam {String} employee_id 职员id.
     * @apiParam {String} employee_name 职员名.
     * @apiParam {String} employee_head_portrait 头像.
     * @apiParam {String} work_unit_id 单位id.
     * @apiParam {String} department_id 部门id.
     * @apiParam {String} position_id 职位.
     *
     */
    router.post('/api/wx/employee/valiateEmployee', controller.employee.valiateEmployee);

    /**
     * @api {post} /api/wx/employee/searchMyScore 查找我的考核成绩
     * @apiName searchMyScore
     * @apiGroup employee-wx
     * 
     * @apiParam {String} employee_id 职员id（利用token获取id）
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.project_id 项目id
     * @apiSuccess {String} data.project_name 项目名
     * @apiSuccess {String} data.project_start_time 开始时间
     * @apiSuccess {String} data.project_end_time 结束时间
     * @apiSuccess {int} data.score 总分
     *
     */
    router.post('/api/wx/employee/searchMyScore', controller.employee.searchMyScore);

    /**
     * @api {post} /api/wx/employee/searchWorkUnit 查找单位
     * @apiName searchWorkUnit
     * @apiGroup employee-wx
     *
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.work_unit_id 单位id
     * @apiSuccess {String} data.work_unit_name 单位名
     */
    router.post('/api/wx/employee/searchWorkUnit', controller.employee.searchWorkUnit);

    /**
     * @api {post} /api/wx/employee/searchDepartmentByWorkUnit 根据单位id查找部门
     * @apiName searchDepartmentByWorkUnit
     * @apiGroup employee-wx
     * 
     * @apiParam {String} work_unit_id 单位id
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.department_id 部门id
     * @apiSuccess {String} data.department_name 部门名
     *
     */
    router.post('/api/wx/employee/searchDepartmentByWorkUnit', controller.employee.searchDepartmentByWorkUnit);

    /**
     * @api {post} /api/wx/employee/searchPositionByDepartment 根据部门id查找职位
     * @apiName searchPositionByDepartment
     * @apiGroup employee-wx
     * 
     * @apiParam {String} department_id 部门id
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.position_id 职位id
     * @apiSuccess {String} data.position_name 职位名
     *
     */
    router.post('/api/wx/employee/searchPositionByDepartment', controller.employee.searchPositionByDepartment);

    /**
     * @api {post} /api/wx/employee/searchGradeAndRule 查找考核项目与规则
     * @apiName searchGradeAndRule
     * @apiGroup employee-wx
     * 
     * @apiParam {String} employee_id 职员id（利用token获取id）
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.project_id 项目id
     * @apiSuccess {String} data.project_name 项目名
     * @apiSuccess {String} data.project_min 最小打分单位
     * @apiSuccess {String} data.project_max 最多可打分数
     * @apiSuccess {String} data.project_is_self 是否可以可自己打分（1：是，2：否）
     * @apiSuccess {Object[]} data.grade_rule 各个职位打分规则
     * @apiSuccess {String} data.grade_rule.position_id 职位id
     * @apiSuccess {String} data.grade_rule.project_score 可打分数
     *
     */
    router.post('/api/wx/employee/searchGradeAndRule', controller.employee.searchGradeAndRule);

    /**
     * @api {post} /api/wx/employee/checkHasProject 检查是否有考核项目
     * @apiName checkHasProject
     * @apiGroup employee-wx
     * 
     * @apiParam {String} employee_id 职员id（利用token获取id）
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {int} data.count 项目数
     *
     */
    router.post('/api/wx/employee/checkHasProject', controller.employee.checkHasProject);

    /**
     * @api {post} /api/wx/employee/searchGradeEmployeeList 查找被考核职员列表
     * @apiName searchGradeEmployeeList
     * @apiGroup employee-wx
     * 
     * @apiParam {String} page 页码
     * @apiParam {String} size 一页显示数量
     * @apiParam {String} employee_id 职员id（利用token获取id）
     * @apiParam {String} [work_unit_id] 单位id
     * @apiParam {String} [department_id] 部门id
     * @apiParam {String} [employee_name] 姓名
     * @apiParam {String} [beGradeed] 被评分（1：是）
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {Object[]} data.alreadyGraded 已评总分
     * @apiSuccess {String} data.alreadyGraded.project_id 项目id
     * @apiSuccess {int} data.alreadyGraded.allScore 已评总分
     * @apiSuccess {int} data.count 被评职员总数
     * @apiSuccess {Object[]} data.employee_list 被评职员列表
     * @apiSuccess {String} data.employee_list.project_id 项目id
     * @apiSuccess {String} data.employee_list.employee_id 职员id
     * @apiSuccess {String} data.employee_list.employee_name 职员名
     * @apiSuccess {int} data.employee_list.score 已评分
     * @apiSuccess {String} data.employee_list.work_unit_name 单位名
     * @apiSuccess {String} data.employee_list.department_name 部门名
     * @apiSuccess {String} data.employee_list.position_name 职位名
     *
     */
    router.post('/api/wx/employee/searchGradeEmployeeList', controller.employee.searchGradeEmployeeList);

    /**
     * @api {post} /api/wx/employee/markingEmployee 给职员打分
     * @apiName markingEmployee
     * @apiGroup employee-wx
     * 
     * @apiParam {String} project_id 项目id
     * @apiParam {String} employee_id 打分职员id（利用token获取id）
     * @apiParam {String} position_id 打分职员所在职位
     * @apiParam {String} target_employee_id 被打分职员id
     * @apiParam {int} grade_result_score 分数
     *
     */
    router.post('/api/wx/employee/markingEmployee', controller.employee.markingEmployee);

    /**
     * @api {post} /api/wx/evaluate/createEvaluate 新增评论
     * @apiName createEvaluate
     * @apiGroup evaluate-wx
     * 
     * @apiParam {String} employee_id 评论职员id（利用token获取id）
     * @apiParam {String} target_employee_id 被评论职员id
     * @apiParam {String} evaluate_content 评论内容
     * @apiParam {String} evaluate_picture 评论图片（多张图片id用逗号隔开）
     *
     */
    router.post('/api/wx/evaluate/createEvaluate', controller.evaluate.createEvaluate);

    /**
     * @api {post} /api/wx/evaluate/deleteEvaluate 删除评论
     * @apiName deleteEvaluate
     * @apiGroup evaluate-wx
     * 
     * @apiParam {String} evaluate_id 评论id
     *
     */
    router.post('/api/wx/evaluate/deleteEvaluate', controller.evaluate.deleteEvaluate);

    /**
     * @api {post} /api/wx/employee/searchEvaluateList 查找部门职员及评价列表
     * @apiName searchEvaluateList
     * @apiGroup employee-wx
     * 
     * @apiParam {String} work_unit_id 单位id
     * @apiParam {String} department_id 部门id
     * @apiParam {String} employee_id 职员id
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.employee_id 职员id
     * @apiSuccess {String} data.employee_name 职员名
     * @apiSuccess {String} data.employee_head_portrait 头像
     * @apiSuccess {String} data.evaluate_id 评价id
     * @apiSuccess {String} data.evaluate_content 评价内容
     * @apiSuccess {String} data.evaluate_picture 评价图片
     *
     */
    router.post('/api/wx/employee/searchEvaluateList', controller.evaluate.searchEvaluateList);

    /**
     * @api {post} /api/wx/evaluate/searchEvaluateById 根据评论id查找评论内容
     * @apiName searchEvaluateById
     * @apiGroup evaluate-wx
     * 
     * @apiParam {String} evaluate_id 评论id
     *
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.evaluate_content 评价内容
     * @apiSuccess {String} data.evaluate_picture 评价图片
     */
    router.post('/api/wx/evaluate/searchEvaluateById', controller.evaluate.searchEvaluateById);

    /**
     * @api {post} /api/wx/evaluate/updateEvaluate 修改评论内容
     * @apiName updateEvaluate
     * @apiGroup evaluate-wx
     * 
     * @apiParam {String} evaluate_id 评论id
     * @apiParam {String} [evaluate_content] 评价内容
     * @apiParam {String} [evaluate_picture] 评价图片
     *
     */
    router.post('/api/wx/evaluate/updateEvaluate', controller.evaluate.updateEvaluate);

    /**
     * @api {post} /api/wx/evaluate/searchEvaluateByEmployeeId 根据职员id查找评论内容
     * @apiName searchEvaluateByEmployeeId
     * @apiGroup evaluate-wx
     * 
     * @apiParam {String} target_employee_id 职员id
     *
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.evaluate_content 评价内容
     * @apiSuccess {String} data.evaluate_picture 评价图片
     */
    router.post('/api/wx/evaluate/searchEvaluateByEmployeeId', controller.evaluate.searchEvaluateByEmployeeId);

    /**
     * @api {post} /api/wx/file/upload 上传图片
     * @apiName upload
     * @apiGroup file-wx
     * 
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.imgName 图片名
     *
     */
    router.post('/api/wx/file/upload', controller.upload.upload);

     /**
     * @api {post} /api/setting/searchSetting 查找系统设置
     * @apiName searchSetting
     * @apiGroup setting
     * 
     * @apiParam {String} setting_key key
     *
     * @apiSuccess {Object} data 返回的数据
     * @apiSuccess {String} data.setting_value value
     */
    router.post('/api/setting/searchSetting', controller.setting.searchSetting);

    /**
     * @api {post} /api/setting/settingRegisterStatus 操作注册状态
     * @apiName settingRegisterStatus
     * @apiGroup setting
     * 
     * @apiParam {String} setting_key key
     * @apiParam {String} setting_value value （1：开启，2：关闭）
     * 
     */
    router.post('/api/setting/settingRegisterStatus', controller.setting.settingRegisterStatus);

    /**
     * @api {get} /api/excel/exportEmployeeExcel 导出excel职员表
     * @apiName exportEmployeeExcel
     * @apiGroup excel
     * 
     */
    router.get('/api/excel/exportEmployeeExcel', controller.upload.exportEmployeeExcel);

    /**
     * @api {get} /api/excel/exportGradeList 导出excel打分表
     * @apiName exportGradeList
     * @apiGroup excel
     * 
     * @apiParam {String} project_id 项目id
     */
    router.get('/api/excel/exportGradeList', controller.upload.exportGradeList);

};
